﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuanLyThongTinNhanKhau.model.BO
{
    class TKTamVangBO
    {
        model.DAO.TKTamVangDAO tkTamVangDAO = new DAO.TKTamVangDAO();
        GUI.TKTamVang f;

        public TKTamVangBO(GUI.TKTamVang tkTamVang)
        {
            f = tkTamVang;
        }

        internal void btnThongKe()
        {
            String fromDate = this.f.dateTimeFromDate.Value.ToString("yyyy-MM-dd");
            String toDate = this.f.dateTimeToDate.Value.ToString("yyyy-MM-dd");

            DataTable dt = tkTamVangDAO.btnThongKe(fromDate, toDate);

            if (dt.Rows.Count != 0)
            {
                this.f.gridControlTKTamVang.DataSource = dt;
            }
            else
            {
                this.f.gridControlTKTamVang.DataSource = null;
            }
        }
    }
}
